package steampunk.entities;

import steampunk.geom.LineGeom;

public class LineFloor extends Entity {
	
	private boolean keepAbove = false;

	public LineFloor(int x, int y, int w) {
		geom = new LineGeom(x, y, x+w, y);
		art = geom.getWireArt();
	}
	
	/**
	 * Sets whether the player can fall through this floor
	 * by pressing 'down'
	 * @param b
	 */
	public void setFallthrough(boolean b) {
		keepAbove = !b;
	}
	
	public boolean allowsFallthrough() {
		return !keepAbove;
	}
	
	private double relativeYDelta(Entity other) {
		double oldDif = other.lastBottom() - lastTop();
		double newDif = other.bottom() - top();
		return newDif - oldDif;
	}
	
	public boolean collideAction(Entity other) {
//		if (keepAbove) {
//			if (relativeYDelta(other) > 0) {
//				other.bottom(top());
//				other.setVelY(getVelY());
//			}
//		}
		
		return true;
	}
}
